local function clearImage(self)
    self.AnimState:ClearOverrideSymbol("SWAP_SIGN")
    return self
end

local function setImage(self, img)
    local shouldwash = true
    if type(img) == "string" then
        local atlas = GetInventoryItemAtlas(img)
        if atlas and TheSim:AtlasContains(atlas, img) then
            self.AnimState:OverrideSymbol("SWAP_SIGN", atlas, img)
            shouldwash = false
        end
    end
    if shouldwash then
        clearImage(self)
    end
    return self
end

local function setAtlasAndImage(self, atlas, image)
    if atlas and image and TheSim:AtlasContains(atlas, image) then
        self.AnimState:OverrideSymbol("SWAP_SIGN", atlas, image)
    else
        clearImage(self)
    end
    return self
end

local function fn()
    local inst = CreateEntity()

    inst.entity:AddTransform()
    inst.entity:AddAnimState()

    inst.AnimState:SetBank("sign_mini")
    inst.AnimState:SetBuild("sign_mini")
    inst.AnimState:PlayAnimation("idle")
    inst.AnimState:SetFinalOffset(1)

    inst:AddTag("sign")

    inst:AddTag("huxi")
	inst:AddTag("NOBLOCK")
    inst:AddTag("NOCLICK")
    inst:AddTag("FX")

    inst.draw = setAtlasAndImage
    inst.wash = clearImage

    return inst
end


return Prefab("huxi_sign", fn)
